﻿<?php
#
# author: Phil Spagnolo
# (c)2008 South Hill Calvary Chapel
#

$linkList = array("history.php","beliefs.php","staff.php?tag=leaders","staff.php");
$textList = array("History", "Beliefs", "Eldership", "Staff");


include_once("./root.inc.php");
include("${root}/mysql/database_info.php");
include("${root}/common.php");
include("${root}/mysql/common.php");


$id = $_GET['id'];

$table = "people";
connect_select_test($table);
$query="SELECT * FROM $table WHERE id='$id'";
$result=mysql_query($query) or die (mysql_error());
mysql_close();

$i=0;
$position=mysql_result($result,$i,"position");
$first=mysql_result($result,$i,"first");
$last=mysql_result($result,$i,"last");
$name = $first." ".$last;
$phone=mysql_result($result,$i,"phone");
$email=mysql_result($result,$i,"email");
$website=mysql_result($result,$i,"website");
$facebook=mysql_result($result,$i,"facebook");
$blog=mysql_result($result,$i,"blog");
$book=mysql_result($result,$i,"book");
$verse=mysql_result($result,$i,"verse");
$scripture=mysql_result($result,$i,"scripture");
$picture=mysql_result($result,$i,"picture");
$picture2=mysql_result($result,$i,"picture2");
$par[0]=mysql_result($result,$i,"par1");
$par[1]=mysql_result($result,$i,"par2");
$par[2]=mysql_result($result,$i,"par3");
$par[3]=mysql_result($result,$i,"par4");

$num_par=count($par);


$title = $name;
$meta_key=$name.' Biography, staff, leaders, meet, pastors, chaplains, ministers, elders';
$meta_desc="We are pleased to introduce ".$name." to you.";
print_html_head($title ,$meta_key,$meta_desc);

print_java_head(NULL);
begin_body();
page_title($title);

printf("<div class='rightbar'>\n");
if (!empty($picture2)) {
	picture_caption($picture2, NULL, NULL, NULL);
} else {
	picture_caption($picture, NULL, NULL, NULL);
}
printf("\t</div>\n");

printf("\t<div class=paragraph>\n");
printf("\t\t<strong><i>%s</i></strong> - %s %s\n", 
       $scripture, $book, $verse);
printf("\t</div>\n");

for ($i=0; $i<$num_par; $i++) {
	if (empty($par[$i])) {
		continue;
	}
	printf("\t<div class=paragraph>\n");
	printf("\t\t%s\n", $par[$i]);
	printf("\t</div>\n");
}
printf("\t<h4>\n");
printf("\t\tMore...\n");
printf("\t</h4>\n");
printf("\t<div class='paragraph'>\n");
printf("\t\t<ul>\n");
printf("\t\t\t<li><a href='mailto:%s'>%s</a></li>\n", $email, $email);
if (!empty($facebook)) {
	printf("\t\t\t<li><a href='%s' target='_blank'><img src='/images/facebook_35x35.png' width='20' height='20'/> Facebook</a></li>\n", $facebook);
}
if (!empty($website)) {
	printf("\t\t\t<li><a href='%s' target='_blank'>Website</a></li>\n", $website);
}
if (!empty($blog)) {
	printf("\t\t\t<li><a href='%s' target='_blank'><img src='/images/wp_35x35.png' width='20' height='20'\> Blog</a></li>\n", $blog);
}
printf("\t\t</ul>\n");
printf("\t</div>\n");

in_page_link(4, false, $linkList, $textList, "");

end_page_title();
end_body();
?>

